package com.example.androidframework.ui.splash

import android.view.View
import com.bumptech.glide.Glide
import com.example.androidframework.R
import com.example.androidframework.databinding.GuideListItemBinding
import com.martin.lib_base.annotation.ItemData
import com.martin.lib_base.base.BaseViewHolder
import com.martin.lib_base.bean.app.splash.GuideData
import com.martin.lib_base.interfaces.IItemData

@ItemData(SplashViewHolder.Companion.ItemData::class)
class SplashViewHolder(view: View) : BaseViewHolder<GuideData, GuideListItemBinding>(view) {

    override fun onBindViewHolder(position: Int, item: Any?) {
        val bean: GuideData = item as GuideData
        // 加载网络图片
        Glide.with(itemView).load(bean.thumb).into(binding.img)
    }

    companion object {
        class ItemData: IItemData {
            override fun getItemLayoutId(): Int = R.layout.guide_list_item
        }
    }

}